#include "../stdafx.h"
#include "Tick.h"
#include "Log.h"
#include <windows.h>

Tick::Tick(void):tickStart(0), tickEnd(0)
{
	Start();
}

Tick::~Tick(void)
{
}
void Tick::Start(){
	tickStart = ::GetTickCount();
}
long Tick::End(const char* prefix){
	tickEnd = ::GetTickCount();
	long tick = tickEnd - tickStart;
	;
	if(prefix){
		Log<<"[Tick] "<<prefix<<":"<<tick<<endl;
	}else{
		Log<<"[Tick] "<<tick<<endl;
	}
	return tick;
}

